package com.uboot;

import com.uboot.uyibai.MainTest;
import lombok.SneakyThrows;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 * @author: LiYang
 * @Email: lyflyyvip@163.com
 * @create: 2020-03-29 20:53
 * @Description:
 **/
public class MainGui {
    private JButton translation;
    private JComboBox selectd;
    private JTextField sourceFile;
    private JLabel label1;
    private JPanel jpanel;
    private JPanel panel1;
    private JPanel panel2;
    private JPanel panel4;
    private JPanel panel5;
    private JPanel textPanel;

    public MainGui() {
        translation.addActionListener(new ActionListener() {
            @SneakyThrows
            @Override
            public void actionPerformed(ActionEvent e) {
                System.out.println(
                        sourceFile.getDocument().getText(0, sourceFile.getDocument().getLength())
                );
                System.out.println(
                        selectd.getSelectedItem()
                );
                MainTest.translate(sourceFile.getDocument().getText(0, sourceFile.getDocument().getLength()));
            }
        });
    }

    private void createUIComponents() {
        // TODO: place custom component creation code here
    }

    public static void main(String[] args) {
        JFrame frame = new JFrame("MainGui");
        frame.setContentPane(new MainGui().jpanel);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
    }

    public void setData(MainGui data) {
    }

    public void getData(MainGui data) {
    }

    public boolean isModified(MainGui data) {
        return false;
    }
}
